package com.palm.hubo2o.view;

import android.graphics.Rect;
import android.support.v7.widget.RecyclerView;
import android.view.View;

/**
 * Created by dest1 on 2015/9/17.
 */
public class GridItemDecoration extends RecyclerView.ItemDecoration {

    private int mMargin;

    public GridItemDecoration(int margin) {
        setMargin(margin);
    }

    @Override
    public void getItemOffsets(Rect outRect, View view,
                               RecyclerView parent, RecyclerView.State state) {
        outRect.set(mMargin, mMargin, mMargin, mMargin);

    }

    public void setMargin(int margin) {
        mMargin = margin;
    }

    public int getMargin() {
        return mMargin;
    }
}
